package cn.ljy.uem.model;


import cn.ljy.authority.model.SysUser;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.Set;

/**
 * 教师类
 *
 * @author 小锋
 * @date 2022/07/18
 */
@ApiModel(value="教师")
@Data
@NoArgsConstructor
public class SchoolTeacher implements java.io.Serializable {

    // 在mapper关联部门属性
    private Long id;

    private Long userId;                                               //用户ID
    private Integer majorId;                                            //所属专业
    private Integer positionId;                                        //职务
    private Integer departmentId;                                       //部门

    @Length(min = 4,max = 20,message = "教师工号的长度必须在{min} - {max}之间")
    private String teacherNumber;                                       //教师工号
    @NotBlank(message = "姓名不能为空")
    @Length(min = 1,max = 20,message = "姓名的长度必须在{min} - {max}之间")
    private String name;                                                //姓名
    @NotNull(message = "性别不能为空")
    @Range(min = 0,max = 2,message = "性别的数值必须在{min} - {max}之间")
    private Integer sex;                                                //性别
    private Date birth;                                                 //出生日期
    @Length(min = 1,max = 20,message = "民族的长度必须在{min} - {max}之间")
    private String national;                                            //民族
    @Length(min = 1,max = 20,message = "籍贯的长度必须在{min} - {max}之间")
    private String nativePlace;                                         //籍贯
    private String address;                                             //家庭地址
    private String tel;                                                 //电话
    private String photo;                                               //个人照片
    private String identityCard;                                        //身份证
    private Boolean remommend;                                           //是否推荐
    private String intro;                                               //个人简介

    private Date createTime;
    private Date updateTime;


    //非数据库字段 教师外键
    private  SysUser sysUser;                                           //对应的系统用户信息
    private  SchoolMajor schoolMajor;                                   //所属专业
    private  SchoolDepartment schoolDepartment;                         //部门
    private  SchoolPosition schoolPosition;                             //职务



    //表格字段部分
    public SchoolTeacher(Integer teacherId) {
    }


    @NotBlank(message = "名称不能为空")
    @Length(min = 2, max = 30, message = "名称长度必须在 {min} - {max} 之间")


    public interface TeacherSex {//用户性别
        int secrecy=0;// 保密
        int MAN = 1;//男
        int WOMAN = 2;//女
    }
    public SchoolTeacher(Long id) {
        this.id = id;
    }


//    //用于传递到前端的数据，偷懒不在编写dto
//    private Set<SchoolCourse> courses;//该教师拥有的课程集合
}
